package com.ai.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ai.web.service.CommentInstallTrainService;
import com.ai.web.vo.CommentInstallTrainV;
import com.ai.web.vo.ResultModel;
import com.tiny.persistence.domain.CommentInstallTrain;
import com.tiny.persistence.repository.CommentInstallTrainRepo;

@Service
public class CommentInstallTrainServiceImpl extends BaseServiceImpl<CommentInstallTrain, Integer, CommentInstallTrainV> implements CommentInstallTrainService  {

    @Autowired
    private CommentInstallTrainRepo commentInstallTrainRepo;
    
    @Autowired
    public CommentInstallTrainServiceImpl(CommentInstallTrainRepo commentInstallTrainRepo) {
        super(commentInstallTrainRepo);
    }

    public CommentInstallTrainV getCommentInstallTrain(int userId) throws Exception {
        return getT(userId);
    }

    public ResultModel saveCommentInstallTrain(CommentInstallTrainV commentInstallTrainV) throws Exception {
        
        CommentInstallTrainV saveV = saveT(commentInstallTrainV);
        
        ResultModel rm = new ResultModel();
        rm.setData(saveV);
        rm.setSuccessCode();
        
        return rm;
    }

    public ResultModel deleteCommentInstallTrains(List<Integer> userIds) throws Exception {
        deleteTs(userIds);
        
        ResultModel rm = new ResultModel();
        rm.setSuccessCode();
        rm.setMsg("删除成功！");
        
        return rm;
    }

}
